package com.sgb.jicai.view.fragment;

import android.os.Bundle;
import android.text.TextUtils;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.widget.NestedScrollView;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.google.android.material.tabs.TabLayout;
import com.sgb.jicai.R;
import com.sgb.jicai.base.JiCaiBaseApi;
import com.sgb.jicai.databinding.FragmentJicaiChangjiaSecondBinding;
import com.sgb.jicai.entity.FactoryCentralizedItemEntity;
import com.sgb.jicai.entity.JiCaiHomeListRequestBean;
import com.sgb.jicai.event.JiCaiEventEntity;
import com.sgb.jicai.view.adapter.FactoryCentralizedListItemAdapter2;
import com.sgb.jicai.viewmodel.JiCaiChangjiaSecondModel;
import com.sgb.link.entity.EventConstant;
import com.sgb.link.utils.PickCateType;
import com.swgk.core.base.AppLazyFragment;
import com.swgk.core.recyclerview.adapter.AdapterOnItemClick;
import com.swgk.core.view.areapopup.AddressEntity;
import com.swgk.core.view.areapopup.GoodsSourceLocationEntity;
import com.swgk.core.view.areapopup.ThreeLevelAreaWindow;
import com.swgk.core.view.selection.CommonPopEntity;
import com.swgk.core.view.selection.CopyUtils;
import com.swgk.core.view.selection.MemberStatusView;
import com.swgk.core.view.selection.XChooseDialog;
import com.swgk.core.view.selection.XChooseEntity;
import com.swgk.core.xrecyclerview.XRecyclerView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
/**
 * 供方发起
 */
public class JiCaiChangjiaSecondFragment extends AppLazyFragment implements MemberStatusView.OnChooseListener, com.swgk.core.view.selection.XChooseDialog.DialogCallBackImpl {

    JiCaiChangjiaSecondModel mModel;
    FragmentJicaiChangjiaSecondBinding mBind;
    private boolean isSearch = false;
    private JiCaiHomeListRequestBean jiCaiBean;
    /**
     * 适配器
     */
    private FactoryCentralizedListItemAdapter2 centralizedMiningAdapter;
    /**
     * 侧边栏类目
     */
    private SparseArray<String> mNameArray;
    /**
     * 侧边栏弹窗
     */
    private XChooseDialog mChooseDialog;

    // 数据集
    private SparseArray<XChooseEntity> mData = new SparseArray<>();
    // 本地缓存筛选结果
    private SparseIntArray mFilters = new SparseIntArray();
    private List<CommonPopEntity> timeDatas = new ArrayList<>();
    //截止时间字段
    private String time = "";
    //搜索key
    private String searchKey = "";
    //集采状态
    private String status = "";
    private List<CommonPopEntity> types;
    //集采范围省份
    private String province = "";
    //集采范围市
    private String city = "";
    //集采范围弹窗
    private ThreeLevelAreaWindow mAddressPop;
    private List<AddressEntity<List<AddressEntity<List<AddressEntity>>>>> scrData;


    /**
     * 集采大厅和集采搜索界面公用
     *
     * @param isSearch 是否是从搜索界面进入
     * @return
     */
    public static JiCaiChangjiaSecondFragment newInstance(boolean isSearch,String search) {
        JiCaiChangjiaSecondFragment fragment = new JiCaiChangjiaSecondFragment();
        Bundle bundle = new Bundle();
        bundle.putBoolean("IS_SEARCH", isSearch);
        bundle.putString("KEY_SEARCH_WORDS", search);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mBind = DataBindingUtil.inflate(inflater, R.layout.fragment_jicai_changjia_second, container, false);
        mModel = new ViewModelProvider(this).get(JiCaiChangjiaSecondModel.class);
        mModel.setActivity(JiCaiChangjiaSecondFragment.this);
        isSearch = getArguments().getBoolean("IS_SEARCH", false);
        searchKey = getArguments().getString("KEY_SEARCH_WORDS");
        return mBind.getRoot();
    }

    @Override
    protected void onLazyLoad() {
        //pop数据列表信息请求
        initPopDataList();
        getData();
    }

    public void getData() {
        mModel.getTenderGoodsCategoryAllList(PickCateType.TYPE_1, "0", false);
        jiCaiBean = new JiCaiHomeListRequestBean();
        jiCaiBean.setSearchKey(searchKey + "");
        mModel.getFactoryCentralizedList(jiCaiBean, false);
    }

    @Override
    protected void initView() {
        if (!EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().register(this);
        }
        mBind.imgBackTop.setOnClickListener(this);
        jiCaiBean = new JiCaiHomeListRequestBean();
        centralizedMiningAdapter = new FactoryCentralizedListItemAdapter2(getActivity(), null,"1");
      /*  centralizedMiningAdapter.setItemCallBack(new FactoryCentralizedListItemAdapter2.ItemClickCallBack() {
            @Override
            public void onItemClick(FactoryCentralizedItemEntity entity) {
                mModel.getH5Url(entity.getNo());
            }
        });*/
        centralizedMiningAdapter.setOnItemClick(new AdapterOnItemClick<FactoryCentralizedItemEntity>() {
            @Override
            public void onItemClick(FactoryCentralizedItemEntity entity, int position) {
                mModel.getH5Url(entity.getNo());
            }
        });
        mBind.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        mBind.recyclerView.setHasFixedSize(true);
        //解决数据加载完成后, 没有停留在顶部的问题
        mBind.recyclerView.setFocusable(false);
        mBind.recyclerView.setAdapter(centralizedMiningAdapter);
        mBind.recyclerView.setLoadingMoreEnabled(true);
        mBind.recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
            @Override
            public void onRefresh() {
                mModel.getFactoryCentralizedList(jiCaiBean, false);
            }

            @Override
            public void onLoadMore() {

            }
        });

        mBind.appBarLayout.addOnOffsetChangedListener((appBarLayout, i) -> {
            if (i >= 0) {
                mBind.svContent.setEnabled(true);
                mBind.recyclerView.setPullRefreshEnabled(true);
            } else {
                mBind.svContent.setEnabled(false);
                mBind.recyclerView.setPullRefreshEnabled(false);
            }
        });
        //二级tabview处理
        TabLayoutView();
        //置顶处理
        DataListTopView();
        //筛选按钮点击处理
        optionData();
        //初始化popview
        initializePopView();
    }

    /**
     * 初始化popview
     */
    private void initializePopView() {
        //集采范围
        initAddressPopup();
        //集采状态
        mBind.jicaiStatus.initPopup(mBind.grayLayout, mBind.popLine, this);
        //集采截止时间
        mBind.deadline.initPopup(mBind.grayLayout, mBind.popLine, this);
    }

    //集采范围
    private void initAddressPopup() {
        mBind.jicaiScope.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (scrData == null || scrData.size() == 0) {
                    mModel.getAddressModel(PickCateType.TYPE_4);
                    return;
                }
                mBind.popLine.setVisibility(View.VISIBLE);
                if (!TextUtils.isEmpty(jiCaiBean.getProvinceNo()) || !TextUtils.isEmpty(jiCaiBean.getCityNo())) {
                    mBind.jicaiScope.updateChooseTextStatus(-2, null);
                } else {
                    mBind.jicaiScope.updateChooseTextStatus(-1, mBind.jicaiScope.getKeyName());
                }
                mAddressPop.showPopwindow0(mBind.popLine);
            }
        });
        mAddressPop = new ThreeLevelAreaWindow(getActivity());
        mAddressPop.setBgView(mBind.grayLayout);
        mAddressPop.setMemberHeight();
        mAddressPop.setCitySingle();
        mAddressPop.setProvinceSingle();
        mAddressPop.setShowSimpleName(true);
        mAddressPop.setOnlyShowProAndCity(true);
        mAddressPop.setAllSingleSelect(true);
        mAddressPop.setThreeListIsGone(true);
        mAddressPop.setOnResultClick(new ThreeLevelAreaWindow.OnResultClickProxy() {
            @Override
            protected void result(GoodsSourceLocationEntity entity) {
                province = "";
                city = "";
                jiCaiBean.setProvinceNo(province);
                jiCaiBean.setCityNo(city);
                mFilters.put(PickCateType.TYPE_4, 0);
                addMainEntity(PickCateType.TYPE_5, new ArrayList<>());
                mBind.jicaiScope.updateChooseTextStatus(0, mBind.jicaiScope.getKeyName());
                if (!TextUtils.isEmpty(entity.getProvinceNo())) {
                    province = entity.getProvinceNo();
                    jiCaiBean.setProvinceNo(province);
                    mBind.jicaiScope.updateChooseTextStatus(1, entity.getProvinceName());
                    mFilters.put(PickCateType.TYPE_4, mAddressPop.getProvincePosition());
                    mModel.getAddressCityData(scrData, province, PickCateType.TYPE_5, false);
                    if (!TextUtils.isEmpty(entity.getCityNo())) {
                        city = entity.getCityNo();
                        jiCaiBean.setCityNo(city);
                        mBind.jicaiScope.updateChooseTextStatus(1, entity.getCityName());
                        mFilters.put(PickCateType.TYPE_5, mAddressPop.getmCityPosition());
                    }
                }
                //刷新数据
                mModel.getFactoryCentralizedList(jiCaiBean, false);
            }
        });
        mAddressPop.setOnDismissListener(() -> {
            if (!TextUtils.isEmpty(jiCaiBean.getProvinceNo()) || !TextUtils.isEmpty(jiCaiBean.getCityNo())) {
                mBind.jicaiScope.updateChooseTextStatus(1, null);
            } else {
                mBind.jicaiScope.updateChooseTextStatus(0, mBind.jicaiScope.getKeyName());
            }
        });
    }


    /**
     * 二级tab类目tab点击处理
     */
    private void TabLayoutView() {
        mBind.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
            @Override
            public void onTabSelected(TabLayout.Tab tab) {
                if (!isPressTabSelect) {
                    return;
                }
                if (tab.getPosition() > 0) {
                    if (types != null && types.size() > 0) {
                        if (types.get(tab.getPosition()) != null) {
                            jiCaiBean.setFirstType(types.get(tab.getPosition()).getNo());
                        } else {
                            jiCaiBean.setFirstType("");
                        }
                    }
                } else {
                    jiCaiBean.setFirstType("");
                    jiCaiBean.setSecondType("");
                }
                mFilters.put(PickCateType.TYPE_1, tab.getPosition());
                updateCategoryData(types.get(tab.getPosition()), tab.getPosition(), false);
                mModel.getFactoryCentralizedList(jiCaiBean, false);

            }

            @Override
            public void onTabUnselected(TabLayout.Tab tab) {

            }

            @Override
            public void onTabReselected(TabLayout.Tab tab) {

            }
        });
    }

    private void updateCategoryData(CommonPopEntity commonPopEntity, int pos, boolean isShowLeftDialog) {
        if (isShowLeftDialog) {
            mChooseDialog.addEntity(PickCateType.TYPE_2, new ArrayList<>());
        } else {
            addMainEntity(PickCateType.TYPE_2, new ArrayList<>());
        }

        if (pos > 0) {
            mModel.getTenderGoodsCategoryAllList(PickCateType.TYPE_2, commonPopEntity.getNo(), isShowLeftDialog);
        }
    }

    private void optionData() {
        //侧边栏筛选项
        initoptionDataDialog();
        mBind.option.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                for (int i = 0; i < mNameArray.size(); i++) {
                    XChooseEntity chooseEntity = mData.get(mData.keyAt(i));
                    if (chooseEntity != null) {
                        if (chooseEntity.getList() == null || chooseEntity.getList().size() == 0) {
                            initPopDataList();
                        }
                    }
                }
                mChooseDialog.initData(mData, mFilters);
                mChooseDialog.showDialog();
            }
        });
    }

    private void initoptionDataDialog() {
        mNameArray = new SparseArray<>();
        mNameArray.put(PickCateType.TYPE_0, "集采状态");
        mNameArray.put(PickCateType.TYPE_1, "商品类型");
        mNameArray.put(PickCateType.TYPE_2, "商品类别");
        mNameArray.put(PickCateType.TYPE_3, "截止时间");
        mNameArray.put(PickCateType.TYPE_4, "省份");
        mNameArray.put(PickCateType.TYPE_5, "市区");
        mChooseDialog = new XChooseDialog(getContext(), mNameArray);
        mChooseDialog.setCallBack(this);
        for (int i = 0; i < mNameArray.size(); i++) {
            int key = mNameArray.keyAt(i);
            addMainEntity(key, new ArrayList<>());
        }
    }

    private void addMainEntity(int index, List<CommonPopEntity> list) {
        if (mData.get(index) != null) {
            if (list == null || list.size() == 0) {
                mData.get(index).setList(new ArrayList<>());
            } else {
                mData.get(index).setList(list);
            }
        } else {
            mData.put(index, new XChooseEntity(index, mNameArray.get(index), list));
        }
        mFilters.put(index, 0);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.img_back_top) {//置顶实现
            topView();
            EventBus.getDefault().post(new JiCaiEventEntity(EventConstant.EVENT_JICAI_TOP_REFRESH_VISIBLE, ""));
        }
    }

    //置顶recyclerView的方法
    private void topView() {
        mBind.svContent.fling(0);
        mBind.svContent.smoothScrollTo(0, 0);
    }

    /**
     * //置顶处理
     */
    private void DataListTopView() {
        mBind.svContent.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
            @Override
            public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
                if (scrollY == 0) {//顶部
                    mBind.imgBackTop.setVisibility(View.GONE);
                } else {
                    mBind.imgBackTop.setVisibility(View.VISIBLE);
                }

                if (scrollY > oldScrollY) {
                    // 向下滑动
                }

                if (scrollY < oldScrollY) {
                    // 向上滑动
                }

                if (scrollY == (v.getChildAt(0).getMeasuredHeight() - v.getMeasuredHeight())) {
                    // 上拉刷新实现
                    mModel.getFactoryCentralizedList(jiCaiBean, true);
                }

            }
        });
    }

    //重置
    public void initializePop() {
        jiCaiBean.setStatus("");
        jiCaiBean.setFirstType("");
        jiCaiBean.setSecondType("");
        jiCaiBean.setTimeIntervals("");
        jiCaiBean.setProvinceNo("");
        jiCaiBean.setCityNo("");
        mFilters.clear();
        resetMainData();
        result(mData, mFilters);
        mChooseDialog.initData(mData, mFilters);
        mBind.jicaiScope.refreshChoose("", "", 0);
        mAddressPop.setDefPosition(0, 0);
    }

    //详情
    public void showUrl(String url) {
        JiCaiBaseApi.startWeb(getActivity(), url);
    }

    //是否联动
    @Override
    public void loadChildData(XChooseEntity entity, int pos) {
        switch (entity.getSort()) {
            case PickCateType.TYPE_1://二级类目
                updateCategoryData(entity.getList().get(pos), pos, true);
                mChooseDialog.showDialog();
                break;
            case PickCateType.TYPE_4://省份
                updateCityData(entity.getList().get(pos), pos, true);
                mChooseDialog.showDialog();
                break;
            default:
                break;
        }
    }

    private void updateCityData(CommonPopEntity entity, int pos, boolean isShowLeftDialog) {
        mChooseDialog.addEntity(PickCateType.TYPE_5, new ArrayList<>());
        if (pos > 0) {
            mModel.getAddressCityData(scrData, entity.getNo(), PickCateType.TYPE_5, isShowLeftDialog);
        }
    }

    //确认
    @Override
    public void result(SparseArray<XChooseEntity> data, SparseIntArray map) {
        mData = CopyUtils.deepPopEntityCopy(data);
        mFilters = map.clone();
        for (int i = 0; i < mData.size(); i++) {
            XChooseEntity entity = mData.get(mData.keyAt(i));
            int key = entity.getSort();
            int value = mFilters.get(key);
            switch (key) {
                case PickCateType.TYPE_0://集采状态
                    status = entity.getItemNo(value);
                    mBind.jicaiStatus.refreshChoose(status, entity.getItemName(value), value);
                    jiCaiBean.setStatus(status);
                    break;
                case PickCateType.TYPE_1://集采二级类目
                    tabSelect(value);
                    jiCaiBean.setFirstType(entity.getItemNo(value) + "");
                    break;
                case PickCateType.TYPE_2://集采类别
                    if (value > 0) {
                        jiCaiBean.setSecondType(entity.getItemNo(value) + "");
                    }
                    break;
                case PickCateType.TYPE_3://截止时间
                    time = entity.getItemNo(value);
                    mBind.deadline.refreshChoose(time, entity.getItemName(value), value);
                    jiCaiBean.setTimeIntervals(time);
                    break;
                case PickCateType.TYPE_4://省份
                    jiCaiBean.setProvinceNo(entity.getItemNo(value) + "");
                    province = entity.getItemNo(value);
                    mBind.jicaiScope.refreshChoose(province, entity.getItemName(value), value);
                    mAddressPop.setDefPosition(value, 0);
                    break;
                case PickCateType.TYPE_5://市区
                    jiCaiBean.setCityNo(entity.getItemNo(value) + "");
                    city = entity.getItemNo(value);
                    mAddressPop.setDefPosition(mFilters.get(PickCateType.TYPE_5), value);
                    if (value > 0) {
                        mBind.jicaiScope.refreshChoose(city, entity.getItemName(value), value);
                    }
                    break;
                default:
                    break;
            }
        }
        mModel.getFactoryCentralizedList(jiCaiBean, false);
    }

    //重置
    @Override
    public void reset() {
        jiCaiBean.setStatus("");
        jiCaiBean.setFirstType("");
        jiCaiBean.setSecondType("");
        jiCaiBean.setTimeIntervals("");
        jiCaiBean.setProvinceNo("");
        jiCaiBean.setCityNo("");
        mFilters.clear();
        resetMainData();
        result(mData, mFilters);
        mChooseDialog.initData(mData, mFilters);
        mChooseDialog.showDialog();
    }

    private void resetMainData() {
        addMainEntity(PickCateType.TYPE_3, new ArrayList<>());
        addMainEntity(PickCateType.TYPE_6, new ArrayList<>());
        mBind.tabLayout.scrollTo(0, 0);
        tabSelect(0);
        jiCaiBean.setTypeNo("");
    }

    private boolean isPressTabSelect;

    private void tabSelect(int pos) {
        isPressTabSelect = false;
        if (mBind.tabLayout.getTabCount() > 0) {
            mBind.tabLayout.postDelayed(new Runnable() {
                @Override
                public void run() {
                    mBind.tabLayout.getTabAt(pos).select();
                    isPressTabSelect = true;
                }
            }, 80);
        }
    }

    //取消
    @Override
    public void onCancel() {
        mChooseDialog.initData(mData, mFilters);
    }

    //pop初始化数据
    @Override
    public void onLoadChooseData(String mKeyName) {
        switch (mKeyName) {
            case "集采状态":
                mModel.groupBuyClassList(PickCateType.TYPE_0, false);
                break;
            case "截止时间":
                mModel.showTimePopWindow(PickCateType.TYPE_3, false);
                break;
        }
    }

    //pop点击事件
    @Override
    public void onChooseResult(String mKeyName, CommonPopEntity entity, Object... objects) {
        int position = (int) objects[0];
        String no = position == 0 ? "" : entity.getNo();
        String id = position == 0 ? "" : entity.getId();
        String name = position == 0 ? "" : entity.getTypeName();
        switch (mKeyName) {
            case "集采状态":
                if (!TextUtils.equals(no, status)) {
                    status = no;
                    jiCaiBean.setStatus(status);
                    mFilters.put(PickCateType.TYPE_0, position);
                    mModel.getFactoryCentralizedList(jiCaiBean, false);
                }
                break;
            case "截止时间":
                if (!TextUtils.equals(no, time)) {
                    time = no;
                    jiCaiBean.setTimeIntervals(time);
                    mFilters.put(PickCateType.TYPE_3, position);
                    mModel.getFactoryCentralizedList(jiCaiBean, false);
                }
                break;

        }
    }

    private void initPopDataList() {
        //分类
        if (isListEmpty(PickCateType.TYPE_1)) {
            mModel.getTenderGoodsCategoryAllList(PickCateType.TYPE_1, "0", false);
        }
        //集采范围
        if (isListEmpty(PickCateType.TYPE_4)) {
            mModel.getAddressModel(PickCateType.TYPE_4);
       }
        //状态
        mModel.groupBuyClassList(PickCateType.TYPE_0, false);
        //截止时间
          if (isListEmpty(PickCateType.TYPE_3)) {
              mModel.showTimePopWindow(PickCateType.TYPE_3, false);
            }
    }

    private boolean isListEmpty(int catType) {
        return mData.get(catType) != null &&
                (mData.get(catType).getList() == null || mData.get(catType).getList().size() == 0);
    }


    public void closeRecyclerRefreshing() {
        mBind.recyclerView.refreshComplete();
        mBind.recyclerView.loadMoreComplete();
    }

    //列表数据信息
    public void setJiCaiList(List<FactoryCentralizedItemEntity> list, boolean loadMore) {
        if (loadMore) {
            if (list != null && list.size() > 0) {
                centralizedMiningAdapter.addDatas(list);
            } else {
                mBind.recyclerView.setNoMore(true);
            }
        } else {
            if (list != null && list.size() > 0) {
                mBind.emptyView.setVisibility(View.GONE);
                mBind.recyclerView.setVisibility(View.VISIBLE);
                centralizedMiningAdapter.setDatas(list);
                mBind.recyclerView.setNoMore(false);
                topView();
            } else {
                centralizedMiningAdapter.clearDatas();
                mBind.emptyView.setVisibility(View.VISIBLE);
                mBind.recyclerView.setVisibility(View.GONE);
            }
        }
    }

    //返回数据信息
    public void showLeftDialog(int type, List<CommonPopEntity> data) {
        mChooseDialog.addEntity(type, data);
        mChooseDialog.showDialog();
    }

    //返回弹窗数据信息
    public void setChooseItemData(int type, List<CommonPopEntity> data) {
        if (data == null || data.size() == 0) return;
        addMainEntity(type, data);
        switch (type) {
            case PickCateType.TYPE_0://集采状态
                mBind.jicaiStatus.setData(data, status);
                break;
            case PickCateType.TYPE_1://二级类目
                types = data;
                mBind.tabLayout.removeAllTabs();
                for (CommonPopEntity datum : data) {
                    mBind.tabLayout.addTab(mBind.tabLayout.newTab().setText(datum.getTypeName()));
                }
                mBind.tabLayout.setVisibility(View.VISIBLE);
                jiCaiBean.setFirstType("");
                tabSelect(0);
                mBind.tabLayout.scrollTo(0, 0);
                break;
            case PickCateType.TYPE_3://截止时间
                mBind.deadline.setData(data, time);
                break;
            case PickCateType.TYPE_4://集采范围
                mBind.jicaiScope.setData(data, province);
                break;
        }
    }

    //省市数据信息
    public void setAddressData(List<AddressEntity<List<AddressEntity<List<AddressEntity>>>>> data) {
        if (data != null && data.size() > 0) {
            scrData = data;
            mAddressPop.setData(data, true);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onEvent(JiCaiEventEntity event) {
        if (event.getCode() == EventConstant.EVENT_JICAI_HOME_FOUR_TYPE_SEARCH) {
            searchKey = event.getName();
            jiCaiBean.setSearchKey(searchKey + "");
            mModel.getFactoryCentralizedList(jiCaiBean, false);
        }
    }
}
